﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace ERPTemplate
{
    public partial class Site_FullPage : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DealUserStatus();
        }
        private void DealUserStatus()
        {
            //this.Page.Title += "-顺通ERP";
            HyperLink_default.Text = this.Page.Title;
            bool isLogin = false;
            //throw new NotImplementedException();
            if (!(RuleCode.CurrentUtil.UserID == ""))
            {
                isLogin = true;
            }

            if (isLogin)
            {
                login.Visible = false;
                regiest.Visible = false;
                loginname.Text = RuleCode.CurrentUtil.UserID + " [用户中心]";
                loginname.NavigateUrl = ResolveUrl("~/Customer/UserInfo.aspx");
                loginname.Target = "_self";
                HyperLink_logout.NavigateUrl = ResolveUrl("~/Logout.aspx")
                    + "?redirecturl=" + this.Request.Url.ToString().Replace("&", "_and_");
                HyperLink_logout.Text = "[注销]";

            }
            else
            {
                login.Visible = true;
                regiest.Visible = true;
                loginname.Visible = false;
                HyperLink_logout.Visible = false;
            }
        }
    }
}
